{php}
    $firstrun = input('param.firstrun/d', 0);
    $admin_1664250281_arr = cookie('admin-1664250281-arr');
    $admin_1664250281_arr = json_decode($admin_1664250281_arr);
    if (1 == $firstrun) {
        $admin_1664250281_arr = null;
    }
{/php}
<div class="sidebar-second order-navBox">
    <ul id="accordion" class="accordion">
        <li data-value="1" {if null === $admin_1664250281_arr || in_array(1, $admin_1664250281_arr)}class="open"{/if}>
            <a class="link">商城设置<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if is_array($admin_1664250281_arr) && !in_array(1, $admin_1664250281_arr)}style="display: none;"{/if}>
                {eq name="'Shop@conf'|is_check_access" value="1"}
                <li>
                    <a href="{:url('Shop/conf')}" {if condition="in_array($Think.const.CONTROLLER_NAME, ['Shop']) && 'conf'==$Think.const.ACTION_NAME"} class="current" {/if}>基础信息</a>
                </li>
                {/eq}
                {eq name="'Other@m_index'|is_check_access" value="1"}
                <li>
                    <a {if condition="in_array($Think.const.CONTROLLER_NAME, ['Other'])"}class="current"{/if} href='{:url("Other/m_index")}'>
                        广告配置
                    </a>
                </li>
                {/eq}
                {eq name="'Shop@address_index'|is_check_access" value="1"}
                <li>
                    <a href="{:url('Shop/address_index')}" {if condition="preg_match('/^address_/i', $Think.const.ACTION_NAME)"} class="current" {/if}>退货地址</a>
                </li>
                {/eq}
                {eq name="'System@api_conf'|is_check_access" value="1"}
                <li>
                    <a href="{:url('System/api_conf')}" {if condition="preg_match('/^api_conf/i', $Think.const.ACTION_NAME)"} class="current" {/if}>支付接口</a>
                </li>
                {/eq}
                {eq name="'Admin@index'|is_check_access" value="1"}
                <li>
                    <a href="{:url('Admin/index')}" {if condition="in_array($Think.const.CONTROLLER_NAME, ['Admin','AuthRole'])"} class="current" {/if}>员工管理</a>
                </li>
                {/eq}
                {eq name="'ShopFreight@index'|is_check_access" value="1"}
                <li>
                    <a href="{:url('ShopFreight/index')}" {if condition="in_array($Think.const.CONTROLLER_NAME, ['ShopFreight'])"} class="current" {/if}>运费模板</a>
                </li>
                {/eq}
            </ul>
        </li>

        {eq name="'Archives@index'|is_check_access" value="1"}
        <li data-value="2" {if null === $admin_1664250281_arr || in_array(2, $admin_1664250281_arr)}class="open"{/if}>
            <a class="link">内容管理<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if is_array($admin_1664250281_arr) && !in_array(2, $admin_1664250281_arr)}style="display: none;"{/if}>
                {eq name="'Help@index'|is_check_access" value="1"}
                <li>
                    <a {if condition="in_array($Request.param.c, ['Help']) && in_array($Think.const.ACTION_NAME, ['index','eyou_add_help','eyou_edit_help'])"}class="current"{/if} href='{:url("Help/index")}'>
                        帮助列表
                    </a>
                </li>
                {/eq}
                {eq name="'Help@arctype_index'|is_check_access" value="1"}
                <li>
                    <a {if condition="in_array($Request.param.c, ['Help']) && in_array($Think.const.ACTION_NAME, ['arctype_index','arctype_add','arctype_edit'])"}class="current"{/if} href='{:url("Help/arctype_index")}'>
                        帮助分类
                    </a>
                </li>
                {/eq}
            </ul>
        </li>
        {/eq}
    </ul>
</div>
<script>
    $(function() {

        openClose();

        $('#accordion > li > a.link').click(function() {
            var $this = $(this);
                $parent = $this.parent();
                $next = $this.next();
            $next.slideToggle();
            $parent.toggleClass('open');
            openClose();
        });

        function openClose()
        {
            var arr = [];
            var className = '';
            $('#accordion > li').each(function(index, item){
                className = " " + $(item).attr('class') + " ";
                if (-1 < className.indexOf(' open ')) {
                    arr.push($(item).data('value'));
                }
            });
            arr = JSON.stringify(arr);
            setCookies('admin-1664250281-arr', arr);
        }
    });
</script>